class RepliesController < ApplicationController
		def editReply
  		@reply = Reply.find(params[:id])
	end
	def update
		  @reply = Reply.find(params[:id])
		  if @reply.update_attributes(params[:reply])
			  @reply.save
			  redirect_to :controller => :replies, :action => :updatePage
		  else render :action => :editReply
		  end
  end
 def updatePage
end

	def index
		@replies = Reply.find(:all)
	end
	def newReply
		@reply = Reply.new(params[:reply])
		@topic = Topic.find(params[:id])
		@topic.replies<<@reply
		@reply.save
		redirect_to :controller => :replies, :action => :backToIndex

	end
def backToIndex
	redirect_to :controller => :categories, :action => :index
end
def deleteReply
		 Reply.find(params[:id]).destroy
		 redirect_to :action => 'ReplyDeleted'

	end
	def ReplyDeleted
	end

end
